{template 'common/header-base'}
{if $_W['role'] != 'clerk'}
<div class="navbar navbar-inverse navbar-static-top base-top" role="navigation" style="position:static;">
    <div class="container-fluid">
        <ul class="nav navbar-nav">
            <li><a href="./?refresh"><i class="fa fa-reply-all"></i>返回商家用户列表</a></li>
            {if !empty($_W['isfounder']) || empty($_W['setting']['permurls']['sections']) || in_array($nav['name'], $_W['setting']['permurls']['sections'])}
            <li{if FRAME == 'weizhan'} class="active"{/if}><a href="{php echo url('weizhan/index', array('multiid' => $multiid))}"><i class="fa fa-life-bouy"></i>微站功能</a></li>
            <li{if FRAME == 'mc'} class="active"{/if}><a href="{php echo url('mc/fans', array('multiid' => $multiid))}"><i class="fa fa-gift"></i>粉丝营销</a></li>
            <li{if FRAME == 'ext'} class="active"{/if}><a href="{php echo url('module/list', array('multiid' => $multiid))}"><i class="fa fa-cubes"></i>独立模块</a></li>
            <li{if FRAME == 'members'} class="active"{/if}><a href="./index.php?c=members&amp;a=member&amp;"><i class="fa fa-cubes"></i>模块续费</a></li>
            {/if}
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li class="dropdown topbar-notice">
                <a type="button" data-toggle="dropdown">
                    <i class="fa fa-bell"></i>
                    <span class="badge" id="notice-total">0</span>
                </a>
                <div class="dropdown-menu" aria-labelledby="dLabel">
                    <div class="topbar-notice-panel">
                        <div class="topbar-notice-arrow"></div>
                        <div class="topbar-notice-head">
                            <span>系统公告</span>
                            <a href="{php echo url('article/notice-show/list');}" class="pull-right">更多公告>></a>
                        </div>
                        <div class="topbar-notice-body">
                            <ul id="notice-container"></ul>
                        </div>
                    </div>
                </div>
            </li>
            <li class="dropdown">
                <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-group"></i>{$_W['account']['name']} <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    {if $_W['role'] != 'operator'}
                    <li><a href="{url 'account/post' array('uniacid' => $_W['uniacid'])}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 编辑当前账号资料</a></li>
                    {/if}
                    <li><a href="{url 'account/display'}" target="_blank"><i class="fa fa-cogs fa-fw"></i> 管理其它公众号</a></li>
                    <li><a href="{url 'utility/emulator'}" target="_blank"><i class="fa fa-mobile fa-fw"></i> 模拟测试</a></li>
                </ul>
            </li>
            <li class="dropdown">
                <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-user"></i>{$_W['user']['username']} ({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}公众号操作员{/if}) <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 我的账号</a></li>
                    {if $_W['role'] == 'founder'}
                    <li class="divider"></li>
                    <li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-sitemap fa-fw"></i> 系统选项</a></li>
                    <li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-cloud-download fa-fw"></i> 自动更新</a></li>
                    <li><a href="{url 'system/updatecache'}" target="_blank"><i class="fa fa-refresh fa-fw"></i> 更新缓存</a></li>
                    <li class="divider"></li>
                    {/if}
                    <li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>
{if empty($_COOKIE['check_setmeal']) && !empty($_W['account']['endtime']) && ($_W['account']['endtime'] - TIMESTAMP < (6*86400))}
<div class="upgrade-tips" id="setmeal-tips">
    <a href="{php echo url('user/edit', array('uid' => $_W['account']['uid']));}" target="_blank">
        您的服务有效期限：{php echo date('Y-m-d', $_W['account']['starttime']);} ~ {php echo date('Y-m-d', $_W['account']['endtime']);}.
        {if $_W['account']['endtime'] < TIMESTAMP}
        目前已到期，请联系管理员续费
        {else}
        将在{php echo floor(($_W['account']['endtime'] - strtotime(date('Y-m-d')))/86400);}天后到期，请及时付费
        {/if}
    </a><span class="tips-close" style="background:#d03e14;" onclick="check_setmeal_hide();"><i class="fa fa-times-circle"></i></span>
</div>
<script>
    function check_setmeal_hide() {
        util.cookie.set('check_setmeal', 1, 1800);
        $('#setmeal-tips').hide();
        return false;
    }
</script>
{/if}
{else}
<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="position:static;">
    <div class="container-fluid">
        <ul class="nav navbar-nav">
            <li><a href="{url 'activity/desk/index'}"><i class="fa fa-desktop"></i> 工作台首页</a></li>
            {if IMS_FAMILY != 'x'}
            <li><a href="http://bbs.yz929.cn"><i class="fa fa-comment"></i>易志科技论坛</a></li>
            <li><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzgwMDA4MzA3NV8yMTc1MThfODAwMDgzMDc1XzJf"><i class="fa fa-suitcase"></i>联系客服</a></li>
            {/if}
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li><a href="javascript:;"><i class="fa fa-user"></i> {$_W['user']['name']} - {$_W['user']['store_name']}</a></li>
            <li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 账号信息</a></li>
            <li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
        </ul>
    </div>
</div>
{/if}
<div class="container-fluid base-content">
    {if defined('IN_MESSAGE')}
    <div class="jumbotron clearfix alert alert-{$label}">
        <div class="row">
            <div class="col-xs-12 col-sm-3 col-lg-2">
                <i class="fa fa-5x fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i>
            </div>
            <div class="col-xs-12 col-sm-8 col-md-9 col-lg-10">
                {if is_array($msg)}
                <h2>MYSQL 错误：</h2>
                <p>{php echo cutstr($msg['sql'], 300, 1);}</p>
                <p><b>{$msg['error'][0]} {$msg['error'][1]}：</b>{$msg['error'][2]}</p>
                {else}
                <h2>{$caption}</h2>
                <p>{$msg}</p>
                {/if}
                {if $redirect}
                <p><a href="{$redirect}">如果你的浏览器没有自动跳转，请点击此链接</a></p>
                <script type="text/javascript">
                    setTimeout(function () {
                        location.href = "{$redirect}";
                    }, 3000);
                </script>
                {else}
                <p>[<a href="javascript:history.go(-1);">点击这里返回上一页</a>] &nbsp; [<a href="./?refresh">首页</a>]</p>
                {/if}
            </div>
            {else}
            <div class="row">
                {php $frames = empty($frames) ? $GLOBALS['frames'] : $frames; _calc_current_frames($frames);}
                <div class="col-xs-12 col-sm-3 col-lg-2 big-menu">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">微站功能</h4>
                            <a class="panel-collapse collapsed" data-toggle="collapse" href="#frame-1">
                                <i class="fa fa-chevron-circle-down"></i>
                            </a>
                        </div>
                        <ul class="list-group collapse in" id="frame-1">
                            <a class="list-group-item {if $action=='index' && $do=='page'}active{/if}" href="{php echo url('weizhan/index/page', array('multiid' => $multiid))}" kw="首页排版">首页排版</a>
                            <a class="list-group-item {if $action=='index' && $do=='quickmenu'}active{/if}" href="{php echo url('weizhan/index/quickmenu', array('multiid' => $multiid))}" kw="自定义菜单">自定义菜单</a>
                            <a class="list-group-item {if $action=='article' || $action=='category'}active{/if}" href="{php echo url('weizhan/article', array('multiid' => $multiid))}" kw="文章管理">文章管理</a>
                        </ul>
                    </div>
                    <script type="text/javascript">
                        require(['bootstrap'], function(){
                            $('.ext-type').click(function(){
                                var id = $(this).data('id');
                                util.cookie.del('ext_type');
                                util.cookie.set('ext_type', id, 8640000);
                                location.reload();
                                return false;
                            });

                            $('#search-menu input').keyup(function() {
                                var a = $(this).val();
                                $('.big-menu .list-group-item, .big-menu .panel-heading').hide();
                                $('.big-menu .list-group-item').each(function() {
                                    $(this).css('border-left', '0');
                                    if(a.length > 0 && $(this).attr('kw').indexOf(a) >= 0) {
                                        $(this).parents(".panel").find('.panel-heading').show();
                                        $(this).show().css('border-left', '3px #428bca double');
                                    }
                                });
                                if(a.length == 0) {
                                    $('.big-menu .list-group-item, .big-menu .panel-heading').show();
                                }
                            });
                        });
                    </script>
                </div>
                <div class="col-xs-12 col-sm-9 col-lg-10 bg_white">
                        {/if}
